package one;

import com.thoughtworks.selenium.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.server.SeleniumServer;

@SuppressWarnings("deprecation")
public class RS_toys extends SeleneseTestCase {
	public SeleniumServer rs;
	@Before
	public void setUp() throws Exception {
		rs=new SeleniumServer();
		rs.start();
		selenium = new DefaultSelenium("localhost", 4444, "*firefox", "http://www.rightstart.com/");
		
		selenium.start();
	}
	



	@Test
	public void testUntitled() throws Exception {
		selenium.open("/");
		selenium.windowMaximize();
		selenium.type("id=search","toys");
		selenium.click("class=btn_search");
		selenium.waitForPageToLoad("60000");
		selenium.click("id=product_list-small_image-img-564");
		selenium.waitForPageToLoad("60000");
		selenium.type("id=qty","2");
		String price = selenium.getText("id=product-price-564");
		
		System.out.println("Price2="+price);
		
		selenium.click("class=btn_add_to_cart2");
		selenium.goBack();
		selenium.click("id=navigation-top-cat-label-707");
		selenium.waitForPageToLoad("60000");
		selenium.click("link=Car Seats");
		selenium.click("//img(@hight='155',@width='260'");
		selenium.click("id=product_list-small_image-img-5622");
		selenium.waitForPageToLoad("60000");
		selenium.click("class='btn_add_to_cart2'");
		selenium.type("id=qty","3");
		selenium.click("id=btn_add_to_cart2");
		@SuppressWarnings("unused")
		String price1 = selenium.getText("id=product_list-small_image-img-5622");
		
		System.out.println("price="+price);
		
		
		
		
		
		
		
		
		
	
		Thread.sleep(5000);
		
	}

	@After
	public void tearDown() throws Exception {
		selenium.stop();
		rs.stop();
	}
}

